from langchain.document_loaders import WebBaseLoader
loader = WebBaseLoader("https://developers.mini1.cn/wiki/luawh.html")
data = loader.load()

from langchain.embeddings.openai import OpenAIEmbeddings
embedding = OpenAIEmbeddings()

from langchain.text_splitter import RecursiveCharacterTextSplitter
text_splitter = RecursiveCharacterTextSplitter(chunk_size=500, chunk_overlap=0)
splits = text_splitter.split_documents(data)

from langchain.vectorstores import FAISS
vectordb = FAISS.from_documents(documents=splits, embedding=embedding)

from langchain.chat_models import ChatOpenAI
from langchain.retrievers.multi_query import MultiQueryRetriever

question = "LUA 的宿主语言是什么？"
llm = ChatOpenAI()

retriever_from_llm = MultiQueryRetriever.from_llm(retriever=vectordb.as_retriever(), llm=llm)

docs = retriever_from_llm.get_relevant_documents(question)

print(docs)